<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>ip::network_v4</title>
    <link rel="stylesheet" href="../../boostbook.css" type="text/css">
    <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
    <link rel="home" href="../../index.html" title="Asio">
    <link rel="up" href="../reference.html" title="Reference">
    <link rel="prev" href="ip__multicast__outbound_interface.html" title="ip::multicast::outbound_interface">
    <link rel="next" href="ip__network_v4/address.html" title="ip::network_v4::address">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%">
    <tr>
        <td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../asio.png"></td>
    </tr>
</table>
<hr>
<div class="spirit-nav">
    <a accesskey="p" href="ip__multicast__outbound_interface.html"><img src="../../prev.png" alt="Prev"></a><a
        accesskey="u" href="../reference.html"><img src="../../up.png" alt="Up"></a><a accesskey="h"
                                                                                       href="../../index.html"><img
        src="../../home.png" alt="Home"></a><a accesskey="n" href="ip__network_v4/address.html"><img
        src="../../next.png" alt="Next"></a>
</div>
<div class="section">
    <div class="titlepage">
        <div>
            <div><h3 class="title">
                <a name="asio.reference.ip__network_v4"></a><a class="link" href="ip__network_v4.html"
                                                               title="ip::network_v4">ip::network_v4</a>
            </h3></div>
        </div>
    </div>
    <p>
        <a class="indexterm" name="asio.indexterm.ip__network_v4"></a>
    </p>
    <p>
        Represents an IPv4 network.
    </p>
    <pre class="programlisting"><span class="keyword">class</span> <span class="identifier">network_v4</span>
</pre>
    <h5>
        <a name="asio.reference.ip__network_v4.h0"></a>
        <span><a name="asio.reference.ip__network_v4.member_functions"></a></span><a class="link"
                                                                                     href="ip__network_v4.html#asio.reference.ip__network_v4.member_functions">Member
        Functions</a>
    </h5>
    <div class="informaltable">
        <table class="table">
            <colgroup>
                <col>
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>
                    <p>
                        Name
                    </p>
                </th>
                <th>
                    <p>
                        Description
                    </p>
                </th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/address.html" title="ip::network_v4::address"><span
                                class="bold"><strong>address</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Obtain the address object specified when the network object was
                        created.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/broadcast.html" title="ip::network_v4::broadcast"><span
                                class="bold"><strong>broadcast</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Obtain an address object that represents the network's broadcast
                        address.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/canonical.html" title="ip::network_v4::canonical"><span
                                class="bold"><strong>canonical</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Obtain the true network address, omitting any host bits.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/hosts.html" title="ip::network_v4::hosts"><span
                                class="bold"><strong>hosts</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Obtain an address range corresponding to the hosts in the network.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/is_host.html" title="ip::network_v4::is_host"><span
                                class="bold"><strong>is_host</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Test if network is a valid host address.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/is_subnet_of.html"
                           title="ip::network_v4::is_subnet_of"><span class="bold"><strong>is_subnet_of</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Test if a network is a real subnet of another network.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/netmask.html" title="ip::network_v4::netmask"><span
                                class="bold"><strong>netmask</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Obtain the netmask that was specified when the network object was
                        created.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/network.html" title="ip::network_v4::network"><span
                                class="bold"><strong>network</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Obtain an address object that represents the network address.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/network_v4.html" title="ip::network_v4::network_v4"><span
                                class="bold"><strong>network_v4</strong></span></a> <span
                            class="silver">[constructor]</span>
                    </p>
                </td>
                <td>
                    <p>
                        Default constructor. <br> <span class="silver"> —</span><br> Construct a network based on
                        the specified address and prefix length. <br> <span class="silver"> —</span><br> Construct
                        network based on the specified address and netmask. <br> <span class="silver"> —</span><br>
                        Copy constructor.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/operator_eq_.html" title="ip::network_v4::operator="><span
                                class="bold"><strong>operator=</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Assign from another network.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/prefix_length.html"
                           title="ip::network_v4::prefix_length"><span
                                class="bold"><strong>prefix_length</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Obtain the prefix length that was specified when the network object
                        was created.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/to_string.html" title="ip::network_v4::to_string"><span
                                class="bold"><strong>to_string</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Get the network as an address in dotted decimal format.
                    </p>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <h5>
        <a name="asio.reference.ip__network_v4.h1"></a>
        <span><a name="asio.reference.ip__network_v4.friends"></a></span><a class="link"
                                                                            href="ip__network_v4.html#asio.reference.ip__network_v4.friends">Friends</a>
    </h5>
    <div class="informaltable">
        <table class="table">
            <colgroup>
                <col>
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>
                    <p>
                        Name
                    </p>
                </th>
                <th>
                    <p>
                        Description
                    </p>
                </th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/operator_not__eq_.html" title="ip::network_v4::operator!="><span
                                class="bold"><strong>operator!=</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Compare two networks for inequality.
                    </p>
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/operator_eq__eq_.html"
                           title="ip::network_v4::operator=="><span class="bold"><strong>operator==</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Compare two networks for equality.
                    </p>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <h5>
        <a name="asio.reference.ip__network_v4.h2"></a>
        <span><a name="asio.reference.ip__network_v4.related_functions"></a></span><a class="link"
                                                                                      href="ip__network_v4.html#asio.reference.ip__network_v4.related_functions">Related
        Functions</a>
    </h5>
    <div class="informaltable">
        <table class="table">
            <colgroup>
                <col>
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>
                    <p>
                        Name
                    </p>
                </th>
                <th>
                    <p>
                        Description
                    </p>
                </th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>
                    <p>
                        <a class="link" href="ip__network_v4/make_network_v4.html"
                           title="ip::network_v4::make_network_v4"><span
                                class="bold"><strong>make_network_v4</strong></span></a>
                    </p>
                </td>
                <td>
                    <p>
                        Create an IPv4 network from a string containing IP address and
                        prefix length.
                    </p>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <p>
        The <a class="link" href="ip__network_v4.html" title="ip::network_v4"><code class="computeroutput"><span
            class="identifier">ip</span><span class="special">::</span><span class="identifier">network_v4</span></code></a>
        class provides the ability to use and manipulate IP version 4 networks.
    </p>
    <h5>
        <a name="asio.reference.ip__network_v4.h3"></a>
        <span><a name="asio.reference.ip__network_v4.thread_safety"></a></span><a class="link"
                                                                                  href="ip__network_v4.html#asio.reference.ip__network_v4.thread_safety">Thread
        Safety</a>
    </h5>
    <p>
        <span class="emphasis"><em>Distinct</em></span> <span class="emphasis"><em>objects:</em></span> Safe.
    </p>
    <p>
        <span class="emphasis"><em>Shared</em></span> <span class="emphasis"><em>objects:</em></span> Unsafe.
    </p>
    <h5>
        <a name="asio.reference.ip__network_v4.h4"></a>
        <span><a name="asio.reference.ip__network_v4.requirements"></a></span><a class="link"
                                                                                 href="ip__network_v4.html#asio.reference.ip__network_v4.requirements">Requirements</a>
    </h5>
    <p>
        <span class="emphasis"><em>Header: </em></span><code class="literal">asio/ip/network_v4.hpp</code>
    </p>
    <p>
        <span class="emphasis"><em>Convenience header: </em></span><code class="literal">asio.hpp</code>
    </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%">
    <tr>
        <td align="left"></td>
        <td align="right">
            <div class="copyright-footer">Copyright © 2003-2022 Christopher M. Kohlhoff<p>
                Distributed under the Boost Software License, Version 1.0. (See accompanying
                file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
            </p>
            </div>
        </td>
    </tr>
</table>
<hr>
<div class="spirit-nav">
    <a accesskey="p" href="ip__multicast__outbound_interface.html"><img src="../../prev.png" alt="Prev"></a><a
        accesskey="u" href="../reference.html"><img src="../../up.png" alt="Up"></a><a accesskey="h"
                                                                                       href="../../index.html"><img
        src="../../home.png" alt="Home"></a><a accesskey="n" href="ip__network_v4/address.html"><img
        src="../../next.png" alt="Next"></a>
</div>
</body>
</html>
